|
|
|
|
|
|
|
This is a simple graph tool that is capable of displaying a single-set, multipoint dataset in the most commonly used graph types. Modifications can be made to this routine to add additional labeling, legends, and text. You could also add options in order to graph more than one set of data per graph. For now, just keep the project simple. When you complete this project, you can add your own modifications. |
|
|
|
|
|
|
|
|
First, you need to add some local storage variables to the class. These contain the passed properties along with a couple of local variables needed for Private methods. Add the code from Listing 11.13 to the class. |
|
|
|
|
|
|
|
|
Listing 11.13. Setting up local storage for the class object. |
|
|
|
|
|
|
|
|
Option Explicit
'
' enumerated graph types
'
Enum dgType
dgPie3d = gphPie3D
dgBar3d = gphBar3D
dgLine = gphLine
dgArea = gphArea
End Enum
'
' local property storage
'
Private intGraphType As Integer
Private strDBName As String
Private strSQLSelect As String
Private strFieldPoint As String
Private strTitle As String
'
' for internal use only
Private ws As Workspace
Private db As Database
Private rs As Recordset
Private lngNumPoints As Long
Private lngLoop As Long
' |
|
|
|
|
|
|
|
|
Notice the use of the Enum..End Enum construct in the declarations section. This is a special type of constant declaration that combines a user-defined type (dgType) with a set of predefined values (dgPie3D, dgBar3D, dgLine, dgArea). When you use this class object in your programs, you can see the enumerated types in the code-complete windows that appear as you enter the source code. |
|
|
|
|
|
|
|
|
Now you need to declare Public properties of the class. These properties allow users to manipulate the local storage variables of the class. Note that all five properties are included |
|
|
|
|
|